From: Eli Zaretskii Date: Sat, 1 Nov 2003 17:11:30 +0000 (+0000) Subject: (texinfo-pre-format-hook): New variable. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~25085 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=922789707ad013a2fc30e2d74ecbbf6b855d5fa3;p=emacs.git (texinfo-pre-format-hook): New variable. (texinfo-format-region): Use it. (texinfo-format-buffer-1): Ditto. --- diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 3b135e1a081..3e79d18a108 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -134,6 +134,11 @@ Info-split to do these manually." (defvar texinfo-region-buffer-name "*Info Region*" "*Name of the temporary buffer used by \\[texinfo-format-region].") +(defvar texinfo-pre-format-hook nil + "Hook called before the conversion of the Texinfo file to Info format. +The functions on this hook are called with argument BUFFER, the buffer +containing the Texinfo file.") + ;; These come from tex-mode.el. (defvar tex-start-of-header) (defvar tex-end-of-header) @@ -215,6 +220,7 @@ converted to Info is stored in a temporary buffer." input-buffer (max region-beginning header-end) region-end) + (run-hook-with-args 'texinfo-pre-format-hook input-buffer) ;; Make sure region ends in a newline. (or (= (preceding-char) ?\n) (insert "\n")) @@ -381,6 +387,7 @@ if large. You can use Info-split to do this manually." (set-syntax-table texinfo-format-syntax-table) (insert-buffer-substring input-buffer) + (run-hook-with-args 'texinfo-pre-format-hook input-buffer) (message "Converting %s to Info format..." (buffer-name input-buffer)) ;; Insert @include files so `texinfo-raise-lower-sections' can